﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AgentQltyList.aspx.cs" Inherits="IHISCETeim.Web.AgentSys.SvrMgr.AgentQltyList" %>
<!DOCTYPE html>
<html>
<head runat="server">
    <title>经销商-已提报品情</title>
    
</head>
<body>
    <form id="form1" runat="server">
        <f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
        <f:Panel ID="Panel1" runat="server" BodyPadding="2px"  
            ShowBorder="false" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start"
            ShowHeader="false">
            <Items>
                <f:Form ID="Form2" runat="server" Height="36px" BodyPadding="2px 1px" ShowHeader="false"
                    ShowBorder="false" LabelAlign="Right" >
                    <Rows>
                        <f:FormRow ID="FormRow1" runat="server">
                            <Items>
                                <f:TwinTriggerBox ID="ttbSearchMessage" runat="server" ShowLabel="false" EmptyText="输入品情号/机号/用户 进行搜索"
                                    Trigger1Icon="Clear" Trigger2Icon="Search" ShowTrigger1="false" OnTrigger2Click="ttbSearchMessage_Trigger2Click"
                                    OnTrigger1Click="ttbSearchMessage_Trigger1Click">
                                </f:TwinTriggerBox>                               
                            </Items>
                        </f:FormRow>
                    </Rows>
                </f:Form>
                <f:Grid ID="Grid1" runat="server" BoxFlex="1" ShowBorder="true" ShowHeader="false"
                    EnableCheckBoxSelect="false"  EnableColumnLines="true" 
                    DataKeyNames="QltyId" AllowSorting="true" OnSort="Grid1_Sort"  SortField="QltyId"
                    SortDirection="DESC" AllowPaging="true" IsDatabasePaging="true" OnPageIndexChange="Grid1_PageIndexChange" OnRowDataBound="Grid1_RowDataBound"  OnRowCommand="Grid1_RowCommand">
                    <Toolbars>
                        <f:Toolbar ID="Toolbar1" runat="server">
                            <Items>
                                <f:Button ID="btnNew" runat="server" Icon="Add" EnablePostBack="false" Text="提报品情" OnClientClick="openAddAgentQlty();"></f:Button>                             
                                <f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>                               
                            </Items>
                        </f:Toolbar>
                    </Toolbars>
                    <PageItems>
                        <f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
                        </f:ToolbarSeparator>
                        <f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数：">
                        </f:ToolbarText>
                        <f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
                            runat="server">
                            <f:ListItem Text="10" Value="10" />
                            <f:ListItem Text="20" Value="20" />
                            <f:ListItem Text="50" Value="50" />
                            <f:ListItem Text="100" Value="100" />   
                        </f:DropDownList>
                    </PageItems>
                    <Columns>
                        <f:RowNumberField Width="30px" EnablePagingNumber="true" TextAlign="Center" />
                        <f:BoundField Width="90px" HeaderText="服务担当"  DataField="SrvActRealName" />
                         <f:TemplateField HeaderText="品情状态"  Width="120px" SortField="ClaimState" >
                            <ItemTemplate>
                               <asp:Label ID="lbClaimState" runat="server"></asp:Label>
                            </ItemTemplate>
                        </f:TemplateField>                        
                        <f:TemplateField HeaderText="品情号"  Width="100px" SortField="ClaimsNumber" >
                            <ItemTemplate>
                                <a href="javascript:openViewQlty(<%# Eval("QltyId") %>,'<%# Eval("ClaimsNumber") %>')" title="查看品情"><%# Eval("ClaimsNumber") %></a>
                            </ItemTemplate>
                        </f:TemplateField>                    
                        <f:BoundField DataField="IssueDate" SortField="IssueDate" Width="100px" HeaderText="发行日期" DataFormatString="{0:yyyy-MM-dd}" /> 
                       <f:LinkButtonField ColumnID="selectSerialNumber" TextAlign="Center" Icon="SystemSearch"  DataTextField="SerialNumber"  ToolTip="查看故障历史"  CommandName="selectSerialNumber" Width="120px" HeaderText="机号" />                      
                        <f:BoundField DataField="CustomerName" SortField="CustomerName" HeaderText="用户" Width="80px" /> 
                        <f:BoundField DataField="FaultDate" SortField="FaultDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="故障日" NullDisplayText="" Width="100px" />  
                        <f:BoundField DataField="WorkHour"  SortField="WorkHour" HeaderText="工作小时" NullDisplayText="0" Width="80px" />      
                        <f:BoundField DataField="ReportUser"  SortField="ReportUser" HeaderText="报告人" NullDisplayText="" Width="80px" />                        
                         <f:TemplateField HeaderText="IHISCE服务部对策与结果"  Width="180px" >
                            <ItemTemplate>
                                <asp:Label ID="lbSvrResult" runat="server"></asp:Label>
                            </ItemTemplate>
                        </f:TemplateField>
                        <f:BoundField DataField="PartsSendDate"  SortField="PartsSendDate" HeaderText="配件发送日期" NullDisplayText="" Width="100px" />  
                        <f:BoundField DataField="PartsSendType"  SortField="PartsSendType" HeaderText="配件发送方式" NullDisplayText="" Width="100px" />
                        <f:BoundField DataField="PartsRequestType_Show"  SortField="PartsRequestType_Show" HeaderText="配件需求情况" NullDisplayText="" Width="180px"/>
                        <f:WindowField ColumnID="changePartsSend" TextAlign="Center" Icon="SystemNew" ToolTip="品情处理进度"
                            WindowID="Window1" Title="品情处理进度" DataIFrameUrlFields="QltyId" DataIFrameUrlFormatString="~/AgentSys/SvrMgr/ChangePartsAcceptDate.aspx?QltyId={0}"
                            Width="100px" HeaderText="品情处理进度"  />
                         <f:BoundField DataField="AgentAcceptDate" SortField="AgentAcceptDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="配件到货时间" NullDisplayText="" Width="100px" />  
                         <f:BoundField DataField="AgentRecoveryDate" SortField="AgentRecoveryDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="故障排除时间" NullDisplayText="" Width="100px" />  
                         <f:TemplateField HeaderText="导出"  Width="70px" TextAlign="Center">
                            <ItemTemplate>
                                <asp:HyperLink ID="execlClaims" runat="server" NavigateUrl="" Text='导出' ></asp:HyperLink>
                            </ItemTemplate>
                        </f:TemplateField>      
                         <f:BoundField DataField="AgentSvrRealName"  SortField="AgentSvrRealName" HeaderText="代理人担当" NullDisplayText="" Width="100px" />  
                         <f:BoundField DataField="AgentSvrTel"  SortField="AgentSvrTel" HeaderText="代理人电话" NullDisplayText="" Width="100px" />  
                    </Columns>
                </f:Grid>
            </Items>
        </f:Panel>
        <f:Window ID="Window1" runat="server" IsModal="true" Hidden="true" Target="Self" EnableResize="true"
            EnableMaximize="true" EnableIFrame="true" IFrameUrl="about:blank" Width="750px"
            Height="550px" OnClose="Window1_Close">
        </f:Window>
    </form>
    <script type="text/javascript">
        var basePath = '<%= ResolveUrl("~/AgentSys/") %>';
        function openAddAgentQlty() {
            var rel = "AddAgentQlty2";
            var url = "SvrMgr/AddAgentQlty2.aspx";
            var title = "提报品情";
            var options = { width: 850, height: 450, max: false, mask: true, maxable: false, minable: false, fresh: true, resizable: false, drawable: true };         
            top.navTab.openTab(rel, url, { title: title, fresh: true, external: false });
            return false;
            //parent.addExampleTab.apply(null, ['AddAgentQlty', basePath + 'SvrMgr/AddAgentQlty2.aspx', '填写品情单','',true]);
        }
        function openViewQlty(QltyId, ClaimsNumber) {
            var rel = "AgentQltyView" + ClaimsNumber;
            var url = "SvrMgr/AgentQltyView2.aspx?QltyId=" + QltyId;
            var title = '查看[' + ClaimsNumber + ']品情';
            var options = { width: 850, height: 450, max: false, mask: true, maxable: false, minable: false, fresh: true, resizable: false, drawable: true };
            top.navTab.openTab(rel, url, { title: title, fresh: true, external: false });
            return false;
            //parent.addExampleTab.apply(null, ['AgentQltyView' + ClaimsNumber, basePath + 'SvrMgr/AgentQltyView.aspx?QltyId=' + QltyId, '查看[' + ClaimsNumber + ']品情', '', true]);
        }
      
       function openExecl(QltyId)
       {
             var url = "<%=this.ExportExcelWebUrl%>" + "/AgentSys/AgentQltyExeclSing.aspx?id=" + QltyId;
            top.window.open(url, "");
       }

        function editQlty(QltyId, ClaimsNumber)
        {
            var rel = "editQlty";
            var url = "SvrMgr/AgentQltyEdit.aspx?QltyId=" + QltyId;
            var title = "重新提交品情" + ClaimsNumber;
            var options = { width: 850, height: 450, max: false, mask: true, maxable: false, minable: false, fresh: true, resizable: false, drawable: true };
            top.navTab.openTab(rel, url, { title: title, fresh: true, external: false });
            return false;
        }
        function editAffiliated(qltyid, ClaimsNumber)
        {
            var rel = "editAffiliated";
            var url = "SvrMgr/AgentQltyEdit.aspx?isAffiliated=1&QltyId=" + qltyid;
            var title = "生成附属品情" + ClaimsNumber;
            var options = { width: 850, height: 450, max: false, mask: true, maxable: false, minable: false, fresh: true, resizable: false, drawable: true };
            top.navTab.openTab(rel, url, { title: title, fresh: true, external: false });
            return false;
        }
    
    </script>
</body>
</html>
